\(\int \frac {\csc ^3(x)}{i+\tan (x)} \, dx\) [7]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 24 \[ \int \frac {\csc ^3(x)}{i+\tan (x)} \, dx=-\frac {1}{2} i \text {arctanh}(\cos (x))-\csc (x)+\frac {1}{2} i \cot (x) \csc (x) \]

[Out]

-1/2*I*arctanh(cos(x))-csc(x)+1/2*I*cot(x)*csc(x)

Rubi [A] (verified)

Time = 0.17 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {3599, 3187, 3186, 2686, 8, 2691, 3855} \[ \int \frac {\csc ^3(x)}{i+\tan (x)} \, dx=-\frac {1}{2} i \text {arctanh}(\cos (x))-\csc (x)+\frac {1}{2} i \cot (x) \csc (x) \]

[In]

Int[Csc[x]^3/(I + Tan[x]),x]

[Out]

(-1/2*I)*ArcTanh[Cos[x]] - Csc[x] + (I/2)*Cot[x]*Csc[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3186

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*sin[c + d*x]^n*(a*cos[c + d*x] + b*sin[c +
 d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IGtQ[p, 0]

Rule 3187

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_), x_Symbol] :> Dist[a^p*b^p, Int[(Cos[c + d*x]^m*Sin[c + d*x]^n)/(b*Cos[c + d*x] + a*Sin
[c + d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[a^2 + b^2, 0] && ILtQ[p, 0]

Rule 3599

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Sin[e + f*x]^
m*((a*Cos[e + f*x] + b*Sin[e + f*x])^n/Cos[e + f*x]^n), x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
 ILtQ[n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cot (x) \csc ^2(x)}{i \cos (x)+\sin (x)} \, dx \\ & = -\left (i \int \cot (x) \csc ^2(x) (\cos (x)+i \sin (x)) \, dx\right ) \\ & = -\left (i \int \left (i \cot (x) \csc (x)+\cot ^2(x) \csc (x)\right ) \, dx\right ) \\ & = -\left (i \int \cot ^2(x) \csc (x) \, dx\right )+\int \cot (x) \csc (x) \, dx \\ & = \frac {1}{2} i \cot (x) \csc (x)+\frac {1}{2} i \int \csc (x) \, dx-\text {Subst}(\int 1 \, dx,x,\csc (x)) \\ & = -\frac {1}{2} i \text {arctanh}(\cos (x))-\csc (x)+\frac {1}{2} i \cot (x) \csc (x) \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(75\) vs. \(2(24)=48\).

Time = 0.04 (sec) , antiderivative size = 75, normalized size of antiderivative = 3.12 \[ \int \frac {\csc ^3(x)}{i+\tan (x)} \, dx=-\frac {1}{2} \cot \left (\frac {x}{2}\right )+\frac {1}{8} i \csc ^2\left (\frac {x}{2}\right )-\frac {1}{2} i \log \left (\cos \left (\frac {x}{2}\right )\right )+\frac {1}{2} i \log \left (\sin \left (\frac {x}{2}\right )\right )-\frac {1}{8} i \sec ^2\left (\frac {x}{2}\right )-\frac {1}{2} \tan \left (\frac {x}{2}\right ) \]

[In]

Integrate[Csc[x]^3/(I + Tan[x]),x]

[Out]

-1/2*Cot[x/2] + (I/8)*Csc[x/2]^2 - (I/2)*Log[Cos[x/2]] + (I/2)*Log[Sin[x/2]] - (I/8)*Sec[x/2]^2 - Tan[x/2]/2

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 41 vs. \(2 (18 ) = 36\).

Time = 5.62 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.75

method result size
default \(-\frac {\tan \left (\frac {x}{2}\right )}{2}-\frac {i \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{8}+\frac {i}{8 \tan \left (\frac {x}{2}\right )^{2}}+\frac {i \ln \left (\tan \left (\frac {x}{2}\right )\right )}{2}-\frac {1}{2 \tan \left (\frac {x}{2}\right )}\) \(42\)
risch \(-\frac {i \left (3 \,{\mathrm e}^{3 i x}-{\mathrm e}^{i x}\right )}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}-\frac {i \ln \left ({\mathrm e}^{i x}+1\right )}{2}+\frac {i \ln \left ({\mathrm e}^{i x}-1\right )}{2}\) \(51\)

[In]

int(csc(x)^3/(I+tan(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2*tan(1/2*x)-1/8*I*tan(1/2*x)^2+1/8*I/tan(1/2*x)^2+1/2*I*ln(tan(1/2*x))-1/2/tan(1/2*x)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 73 vs. \(2 (16) = 32\).

Time = 0.26 (sec) , antiderivative size = 73, normalized size of antiderivative = 3.04 \[ \int \frac {\csc ^3(x)}{i+\tan (x)} \, dx=\frac {{\left (-i \, e^{\left (4 i \, x\right )} + 2 i \, e^{\left (2 i \, x\right )} - i\right )} \log \left (e^{\left (i \, x\right )} + 1\right ) + {\left (i \, e^{\left (4 i \, x\right )} - 2 i \, e^{\left (2 i \, x\right )} + i\right )} \log \left (e^{\left (i \, x\right )} - 1\right ) - 6 i \, e^{\left (3 i \, x\right )} + 2 i \, e^{\left (i \, x\right )}}{2 \, {\left (e^{\left (4 i \, x\right )} - 2 \, e^{\left (2 i \, x\right )} + 1\right )}} \]

[In]

integrate(csc(x)^3/(I+tan(x)),x, algorithm="fricas")

[Out]

1/2*((-I*e^(4*I*x) + 2*I*e^(2*I*x) - I)*log(e^(I*x) + 1) + (I*e^(4*I*x) - 2*I*e^(2*I*x) + I)*log(e^(I*x) - 1)
- 6*I*e^(3*I*x) + 2*I*e^(I*x))/(e^(4*I*x) - 2*e^(2*I*x) + 1)

Sympy [F]

\[ \int \frac {\csc ^3(x)}{i+\tan (x)} \, dx=\int \frac {\csc ^{3}{\left (x \right )}}{\tan {\left (x \right )} + i}\, dx \]

[In]

integrate(csc(x)**3/(I+tan(x)),x)

[Out]

Integral(csc(x)**3/(tan(x) + I), x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 59 vs. \(2 (16) = 32\).

Time = 0.20 (sec) , antiderivative size = 59, normalized size of antiderivative = 2.46 \[ \int \frac {\csc ^3(x)}{i+\tan (x)} \, dx=-\frac {{\left (\frac {4 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - i\right )} {\left (\cos \left (x\right ) + 1\right )}^{2}}{8 \, \sin \left (x\right )^{2}} - \frac {\sin \left (x\right )}{2 \, {\left (\cos \left (x\right ) + 1\right )}} - \frac {i \, \sin \left (x\right )^{2}}{8 \, {\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {1}{2} i \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

integrate(csc(x)^3/(I+tan(x)),x, algorithm="maxima")

[Out]

-1/8*(4*sin(x)/(cos(x) + 1) - I)*(cos(x) + 1)^2/sin(x)^2 - 1/2*sin(x)/(cos(x) + 1) - 1/8*I*sin(x)^2/(cos(x) +
1)^2 + 1/2*I*log(sin(x)/(cos(x) + 1))

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 46 vs. \(2 (16) = 32\).

Time = 0.33 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.92 \[ \int \frac {\csc ^3(x)}{i+\tan (x)} \, dx=-\frac {1}{8} i \, \tan \left (\frac {1}{2} \, x\right )^{2} - \frac {6 i \, \tan \left (\frac {1}{2} \, x\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, x\right ) - i}{8 \, \tan \left (\frac {1}{2} \, x\right )^{2}} + \frac {1}{2} i \, \log \left (\tan \left (\frac {1}{2} \, x\right )\right ) - \frac {1}{2} \, \tan \left (\frac {1}{2} \, x\right ) \]

[In]

integrate(csc(x)^3/(I+tan(x)),x, algorithm="giac")

[Out]

-1/8*I*tan(1/2*x)^2 - 1/8*(6*I*tan(1/2*x)^2 + 4*tan(1/2*x) - I)/tan(1/2*x)^2 + 1/2*I*log(tan(1/2*x)) - 1/2*tan
(1/2*x)

Mupad [B] (verification not implemented)

Time = 4.74 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.71 \[ \int \frac {\csc ^3(x)}{i+\tan (x)} \, dx=-\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{2}+\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,1{}\mathrm {i}}{2}-\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )-\frac {1}{2}{}\mathrm {i}}{4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,1{}\mathrm {i}}{8} \]

[In]

int(1/(sin(x)^3*(tan(x) + 1i)),x)

[Out]

(log(tan(x/2))*1i)/2 - tan(x/2)/2 - (2*tan(x/2) - 1i/2)/(4*tan(x/2)^2) - (tan(x/2)^2*1i)/8